package com.gec.service;

import com.gec.mapper.UserMapper;
import com.gec.pojo.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 12691
 * @version 1.0
 * @description: TODO
 * @date 2024/9/9 18:37
 */
@Service("Service")
public class userServiceImpl implements userService{

    @Autowired
    private UserMapper userMapper;
    @Override
    public List<Users> getUsers() {
        return userMapper.selectList(null);
    }

    @Override
    public Integer addUser(Users users) {
        return userMapper.insert(users);
    }

    @Override
    public Integer deleteUser(Integer id) {
        return userMapper.deleteById(id);
    }

    @Override
    public Users queryByid(Integer id) {
        return userMapper.selectById(id);
    }

    @Override
    public Integer update(Users users) {
        return userMapper.update(users);
    }
}
